import {rgb} from "chalk";

// 首页图表JS

// 咨询人数图表
export function Advice(data) {

  // console.log(data)
  // console.log(data)
  // var phone = []
  // var offline = []
  // var name = []
  // console.log(barlist)

  return {
    tooltip: {
      trigger: 'axis',
      axisPointer: {
        type: 'shadow'
      }
    },
    grid: {
      containLabel: true
    },
    xAxis: [
      {
        type: 'category',
        data: ['信息学院','电气工程'],
        axisTick:{
          alignWithLabel:true
        },
        offset:0,
      }
    ],
    yAxis: [
      {
        type: 'value'
      }
    ],
    series: [
      {
        name: '电话咨询',
        type: 'bar',
        barWidth: '40%',
        barGap: '0%',
        data: [{
          value:20,
          itemStyle: {
            color: 'rgb(80,135,226)'
          },
        },
          {
            value: 15,
            itemStyle: {
              color: 'rgb(80,135,226)'
            },
          },
        ],
      },
      {
        name: '线下咨询',
        type: 'bar',
        barWidth: '40%',
        barGap: '0%',
        data: [{
          value:15,
          itemStyle: {
            color: 'rgb(104,187,196)'
          },
        },
          {
            value:17,
            itemStyle: {
              color: 'rgb(104,187,196)'
            },
          },
          {
            value:8,
            itemStyle: {
              color: 'rgb(104,187,196)'
            },
          },
        ],
      },
    ]
  }

}

// 男女比例图表
export function Wmen() {
  return {
    tooltip: {
      trigger: 'axis'
    },
    series: [
      {
        name: '男女比例',
        type: 'pie',
        radius: '50%',
        data: [
          {value: 100, name: '男'},
          {
            value: 150,
            name: '女',
            itemStyle: {
              color: 'rgb(104,187,196)'
            },
          },
        ],
        label: {
          alignTo: 'edge',
          formatter: '{name|{b}}\n{time|{c}}',
          minMargin: 15,
          edgeDistance: 70,
          lineHeight: 15,
          width: 18,
          rich: {
            time: {
              fontSize: 10,
              color: '#999'
            }
          }
        },
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  }
}

export function Menw() {
  return {
    tooltip: {
      trigger: 'item'
    },
    series: [
      {
        name: '男女比例',
        type: 'pie',
        radius: '50%',
        data: [
          {value: 100, name: '本科'},
          {
            value: 150,
            name: '研究生',
            itemStyle: {
              color: 'rgb(104,187,196)'
            },
          },
        ],
        label: {
          alignTo: 'edge',
          formatter: '{name|{b}}\n{time|{c}}',
          minMargin: 5,
          edgeDistance: 50,
          lineHeight: 15,
          width: 40,
          rich: {
            time: {
              fontSize: 10,
              color: '#999'
            }
          }
        },
        emphasis: {
          itemStyle: {
            shadowBlur: 10,
            shadowOffsetX: 0,
            shadowColor: 'rgba(0, 0, 0, 0.5)'
          }
        }
      }
    ]
  }
}
